<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="theme-color" content="#222">






  
  
  <link rel="stylesheet" media="all" href="/lib/Han/dist/han.min.css?v=3.3">




<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css" />


  <link rel="apple-touch-icon" sizes="180x180" href="/images/favicon.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon.png?v=5.1.4">


  <link rel="mask-icon" href="/images/favicon.png?v=5.1.4" color="#222">





  <meta name="keywords" content="面经 - C++," />





  <link rel="alternate" href="/atom.xml" title="平步青云win" type="application/atom+xml" />






<meta name="description" content="钉钉C++研发工程师：主要是windows开发   oc 腾讯wxg和ieg：C++后台发开                          oc 字节：客户端开发 美团：服务端开发                                             oc 拼多多：服务端开发 百度：C++开发工程师 华为：消费者BG软件开发 网易：游戏研发">
<meta name="keywords" content="面经 - C++">
<meta property="og:type" content="article">
<meta property="og:title" content="C++后端和桌面端开发面试总结-2021暑期实习">
<meta property="og:url" content="https://zxpgo.github.io/2020/04/04/C++面经总结/index.html">
<meta property="og:site_name" content="平步青云win">
<meta property="og:description" content="钉钉C++研发工程师：主要是windows开发   oc 腾讯wxg和ieg：C++后台发开                          oc 字节：客户端开发 美团：服务端开发                                             oc 拼多多：服务端开发 百度：C++开发工程师 华为：消费者BG软件开发 网易：游戏研发">
<meta property="og:locale" content="zh-Hans">
<meta property="og:updated_time" content="2020-05-08T06:33:18.014Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="C++后端和桌面端开发面试总结-2021暑期实习">
<meta name="twitter:description" content="钉钉C++研发工程师：主要是windows开发   oc 腾讯wxg和ieg：C++后台发开                          oc 字节：客户端开发 美团：服务端开发                                             oc 拼多多：服务端开发 百度：C++开发工程师 华为：消费者BG软件开发 网易：游戏研发">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"right","display":"post","offset":10,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: 'PAO8LM7QB1',
      apiKey: '',
      indexName: 'Blog',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="https://zxpgo.github.io/2020/04/04/C++面经总结/"/>





  <title>C++后端和桌面端开发面试总结-2021暑期实习 | 平步青云win</title>
  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?7a4517a3ce6d7c50203655d056f01ac3";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-right page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">平步青云win</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <h1 class="site-subtitle" itemprop="description"></h1>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-随笔">
          <a href="/sui" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-question-circle"></i> <br />
            
            随笔
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="popup-trigger">
			
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <div class="popup search-popup local-search-popup">
  <div class="local-search-header clearfix">
    <span class="search-icon">
      <i class="fa fa-search"></i>
    </span>
    <span class="popup-btn-close">
      <i class="fa fa-times-circle"></i>
    </span>
    <div class="local-search-input-wrapper">
      <input autocomplete="off"
             placeholder="搜索..." spellcheck="false"
             type="text" id="local-search-input">
    </div>
  </div>
  <div id="local-search-result"></div>
</div>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="https://zxpgo.github.io/2020/04/04/C++面经总结/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="zxp">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="平步青云win">
    </span>

    
      <header class="post-header">

        
        
          <h2 class="post-title" itemprop="name headline">C++后端和桌面端开发面试总结-2021暑期实习</h2>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2020-04-04T17:24:24+08:00">
                2020-04-04
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/笔试和面试/" itemprop="url" rel="index">
                    <span itemprop="name">笔试和面试</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          
             <span id="/2020/04/04/C++面经总结/" class="leancloud_visitors" data-flag-title="C++后端和桌面端开发面试总结-2021暑期实习">
               <span class="post-meta-divider">|</span>
               <span class="post-meta-item-icon">
                 <i class="fa fa-eye"></i>
               </span>
               
                 <span class="post-meta-item-text">阅读次数&#58;</span>
               
                 <span class="leancloud-visitors-count"></span>
             </span>
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body han-init-context" itemprop="articleBody">

      
      

      
        <ul>
<li>钉钉C++研发工程师：主要是windows开发   oc</li>
<li>腾讯wxg和ieg：C++后台发开                          oc</li>
<li>字节：客户端开发</li>
<li>美团：服务端开发                                             oc</li>
<li>拼多多：服务端开发</li>
<li>百度：C++开发工程师</li>
<li>华为：消费者BG软件开发</li>
<li>网易：游戏研发                                                 oc</li>
<li>微软：苏州研究院软件开发</li>
</ul>
<a id="more"></a>
<h1 id="钉钉C"><a href="#钉钉C" class="headerlink" title="钉钉C++"></a>钉钉C++</h1><h2 id="一面"><a href="#一面" class="headerlink" title="一面"></a>一面</h2><ul>
<li><p>项目介绍</p>
</li>
<li><p>自己觉得最有价值的项目，说说其中遇到的问题怎么解决的？越多越好</p>
</li>
<li><p>C++</p>
<ul>
<li>虚函数的原理和作用</li>
<li>左值和右值区别，以及右值是否可以转换成左值</li>
<li>浅拷贝和深拷贝的区别，以及为什么需要深拷贝</li>
<li>内存管理方面遇到的问题</li>
<li>出现内存错误，可以通过反编译查出来吗？</li>
</ul>
</li>
<li>计算机网络<ul>
<li>TCP三次握手和四次挥手的过程</li>
<li>TCP为什么需要三次握手，而不是两次</li>
</ul>
</li>
<li>操作系统<ul>
<li>怎么控制多个线程同时写的问题</li>
<li>多个线程，中间有些线程读，有些线程写，如何控制写线程执行时，其他线程无法执行，没有写进程时，所有读线程可以执行</li>
</ul>
</li>
<li>数据结构<ul>
<li>二叉树的遍历方式</li>
<li>介绍一下在实际中用到遍历方法的例子，编程题也可以</li>
</ul>
</li>
<li>手写代码<ul>
<li>字符串转整数，实现atoi函数</li>
</ul>
</li>
</ul>
<h2 id="二面"><a href="#二面" class="headerlink" title="二面"></a>二面</h2><ul>
<li>C++    <ul>
<li>怎么学习C++的？在你看过的书中最有印象是哪一本？讲讲这本书中最有印象的点</li>
<li>堆爆破</li>
<li>explicit关键词</li>
<li>什么是内存泄露，野指针</li>
<li>怎么让一个程序在main函数结束后还输出一段内容</li>
<li>虚函数表</li>
</ul>
</li>
<li>菱形继承<ul>
<li>虚继承：解决菱形继承中的问题</li>
<li>怎么判断内存泄露</li>
</ul>
</li>
<li>操作系统<ul>
<li>进程和线程区别</li>
<li>一个进程，有多少个堆和栈</li>
<li>多个线程，主线程结束了，其他子线程会怎么办</li>
<li>进程切换技术</li>
<li>虚拟内存</li>
<li>原子锁</li>
<li>一个线程怎么杀死另一个线程</li>
</ul>
</li>
<li>算法<ul>
<li>排序算法介绍一下包括时间复杂度，以及对于有序数组，那个时间最短</li>
</ul>
</li>
<li>手写代码<ul>
<li>判断一个文件中是否包含敏感词汇</li>
</ul>
</li>
</ul>
<h2 id="三面"><a href="#三面" class="headerlink" title="三面"></a>三面</h2><ul>
<li>虚函数，虚表</li>
<li>STL容器，底层实现，红黑树和哈希表的对比</li>
<li>QT的信号槽机制原理，对应什么设计模式：观察者模式</li>
<li>问题都比较深</li>
<li>给我推荐了三本书《C++对象模型》，《windows核心编程》和《windows高级编程》，推荐我实现一个notepad程序</li>
<li>做了notepad给面试官，直接过了，走下面的流程</li>
</ul>
<h2 id="四面-40m"><a href="#四面-40m" class="headerlink" title="四面(40m)"></a>四面(40m)</h2><p>全程聊天</p>
<h2 id="五面-10m"><a href="#五面-10m" class="headerlink" title="五面(10m)"></a>五面(10m)</h2><p>全程聊天</p>
<h2 id="交叉面-1h20m"><a href="#交叉面-1h20m" class="headerlink" title="交叉面(1h20m)"></a>交叉面(1h20m)</h2><ul>
<li>自我介绍</li>
<li>如何隐藏一个类的声明和实现，比如类B要使用类A的一些内容，但是希望用户使用类B的时候，不知道类A的任何东西</li>
<li>怎么将静态变量的初始化滞后，因为load os阶段要进行很多静态变量的初始化，这样占据了大量的时间，怎么来解决？</li>
<li>C++虚表的实现原理</li>
<li>C++存在哪些内存方面的问题</li>
<li>怎么在一个指定的内存中构造一个对象</li>
<li>最有印象的设计模式解决一下</li>
<li>解释一下汇编和链接两个阶段的不同</li>
<li>C怎么实现C++的类</li>
<li>C和C++的区别</li>
<li>条件遍历是怎么实现的</li>
<li>sizeof一个对象的大小，是怎么求的</li>
<li>内存对齐是怎么做的，为什么要内存对齐</li>
<li>怎么去判断内存泄漏</li>
<li>C++中struct和class的区别</li>
<li>你身边有没有啥技术比较厉害的，讲一讲</li>
</ul>
<h2 id="hr面-4-10-36m"><a href="#hr面-4-10-36m" class="headerlink" title="hr面(4.10, 36m)"></a>hr面(4.10, 36m)</h2><ul>
<li>自我介绍</li>
<li>情感经历</li>
<li>兴趣爱好</li>
<li>自己的规划</li>
<li>找工作是否跟父母沟通过</li>
<li>是否已经有offer，为什么选择杭州，除了地点还有哪些理由让你选择钉钉</li>
<li>为什么选择读研，研究生生活跟之前想的有没有啥不同</li>
<li>项目介绍</li>
<li>建议：沟通需要有条理，说完最后做一个总结</li>
</ul>
<h1 id="腾讯wxg后端开发"><a href="#腾讯wxg后端开发" class="headerlink" title="腾讯wxg后端开发"></a>腾讯wxg后端开发</h1><h2 id="一面-1"><a href="#一面-1" class="headerlink" title="一面"></a>一面</h2><ul>
<li>TCP三次握手，如果第三次客户端没有响应，服务端会怎么做？</li>
<li>HTTP和HTTPS的区别</li>
<li>IO多路复用，epoll的重排是怎么做的？</li>
<li>协程，进程和线程的区别</li>
<li>虚拟内存<ul>
<li>多个进程的地址可以一样吗？</li>
<li>虚拟地址到物理地址怎么映射的？</li>
</ul>
</li>
<li>虚函数，虚表<ul>
<li>如果类C继承自A,B，那么类C中有几个虚表？</li>
<li>怎么找到虚函数的地址？</li>
<li>子类可以调用父类的虚函数吗？</li>
</ul>
</li>
<li>.o文件到.dll文件的过程，讲讲是如何链接的？</li>
<li>项目</li>
<li>六道算法题</li>
</ul>
<h2 id="二面-1"><a href="#二面-1" class="headerlink" title="二面"></a>二面</h2><p>全程问项目，遇到的问题，以及一些技术的深入，比如FASTCGI的原理，Docker和K8s的区别等等。然后一直问我还有没有补充的。<br>最后问我有啥问题没</p>
<h2 id="三面-1"><a href="#三面-1" class="headerlink" title="三面"></a>三面</h2><p>全程问项目<br>结果：挂了</p>
<h1 id="腾讯游戏后台安全开发"><a href="#腾讯游戏后台安全开发" class="headerlink" title="腾讯游戏后台安全开发"></a>腾讯游戏后台安全开发</h1><p>再次被捞</p>
<h2 id="第一面"><a href="#第一面" class="headerlink" title="第一面"></a>第一面</h2><ul>
<li>看过的书，介绍一下</li>
<li>浏览器输入一个网址，会发生一些什么事</li>
<li>最有成就感的一件事</li>
<li>你的优点和缺点</li>
<li>Linux命令</li>
</ul>
<h2 id="第二面"><a href="#第二面" class="headerlink" title="第二面"></a>第二面</h2><ul>
<li>虚函数内部实现机制，调用的过程</li>
<li>项目<ul>
<li>FASTDFS的工作原理，备份和容灾方面的处理</li>
</ul>
</li>
<li>TCP结束时的四个状态</li>
<li>20多分钟</li>
</ul>
<h2 id="HR面"><a href="#HR面" class="headerlink" title="HR面"></a>HR面</h2><ul>
<li>觉得最有价值的实习</li>
<li>在实现过程中学到的东西</li>
<li>在工作学习生活中遇到的最大的困难</li>
<li>工作地点，父母对工作地点又要求吗</li>
<li>你当班干部是因为兴趣还是想提升自己在这一方面的能力</li>
<li>实习中除了技术上，还有啥体会吗</li>
<li>投过哪些公司？会优先选择哪个</li>
<li>之前投的wxg，现在换成ieg的，岗位有什么想法吗</li>
<li>15分钟左右</li>
</ul>
<p>结果：OC</p>
<h1 id="字节跳动"><a href="#字节跳动" class="headerlink" title="字节跳动"></a>字节跳动</h1><p>投的C++客户端开发，转成抖音android客户端发开-上海</p>
<h2 id="第一面-1"><a href="#第一面-1" class="headerlink" title="第一面"></a>第一面</h2><ul>
<li>自我介绍</li>
<li>项目介绍<ul>
<li>Android打包的过程，为什么要签名，签名的原理是什么？</li>
</ul>
</li>
<li>开始投的C++客户端开发，后来被调到android开发，所以主要问了C++的内容<ul>
<li>C与C++区别</li>
<li>sizeof一个空类</li>
<li>C++三大特性</li>
<li>struct和class的区别</li>
<li>多态介绍</li>
<li>map和set底层实现</li>
<li>vector和list的区别</li>
<li>虚函数，虚表</li>
<li>delete的背后实现</li>
<li>智能指针</li>
<li>虚函数可以是内联函数吗？</li>
</ul>
</li>
<li>操作系统<ul>
<li>进程间通信方式</li>
<li>两个进程之间怎么共享内存的？</li>
<li>虚拟内存，分页机制，虚拟地址怎么映射到物理地址？</li>
<li>死锁，AB两个进程，cd两个资源，怎么才会形成死锁</li>
</ul>
</li>
<li>计算机网络<ul>
<li>浏览器输入网址背后的内容</li>
<li>HTTP是否有状态</li>
<li>cookie的原理，为什么服务端需要session，而不是直接存储用户名和密码？</li>
<li>HTTPDNS</li>
<li>UDP和TCP的区别</li>
<li>DNS使用UDP还是TCP</li>
</ul>
</li>
<li>代码</li>
<li>无重复字符的最长子串</li>
</ul>
<p>结果：挂了</p>
<h1 id="美团"><a href="#美团" class="headerlink" title="美团"></a>美团</h1><h2 id="第一面-2"><a href="#第一面-2" class="headerlink" title="第一面"></a>第一面</h2><ul>
<li>多路IO服用</li>
<li>进程和线程的区别</li>
<li>进程间通信方式</li>
<li>redis同步方式</li>
<li>分布式怎么来处理请求</li>
<li>mysql和redis的区别</li>
<li>mysql的两种存储引擎的区别</li>
<li>mysql表有几种连接方式，内连接，左连接和右连接</li>
<li>怎么处理高并发，除了多路IO服用，貌似还有线程池，分布式</li>
<li>TCP的三次握手</li>
<li>TCP拥塞控制</li>
<li>TCP的窗口机制主要解决什么问题</li>
<li>TCP拥塞控制主要解决什么问题</li>
<li>HTTP的长连接和短连接的区别</li>
<li>scoket编程，服务端怎么处理请求的</li>
<li>如果判断一个包使重传的包</li>
<li>手撕快排</li>
<li>有什么问题：<ul>
<li>主要做什么业务</li>
<li>对我的评价<br>全程一个小时不到。</li>
</ul>
</li>
</ul>
<h2 id="第二面-1"><a href="#第二面-1" class="headerlink" title="第二面"></a>第二面</h2><ul>
<li>自我介绍</li>
<li>redis</li>
<li>http的一些方法</li>
<li>网络编程中，服务端怎么处理请求</li>
<li>tcp和udp的区别</li>
<li>哪些应用层协议使用udp和tcp</li>
<li>c++多线程怎么实现同步</li>
<li>liunx的命令这一块，我强调之前用过，现在不太熟悉，对操作系统知识比较了解<ul>
<li>如果修改文件权限</li>
</ul>
</li>
<li>如果读一个几G的文件</li>
<li>查看端口</li>
<li>redis有哪些数据结构</li>
<li>中间件，因为不了解直接说不会，说了一个RCP啥的，我也忘记了</li>
<li>项目介绍：这个时间占大头</li>
<li>你是怎么学习</li>
<li>对未来的规划</li>
<li>反问：对我的评价</li>
<li>手撕代码<ul>
<li>有序链表合并</li>
<li>如果链表无序怎么处理<br>全程四十分钟左右</li>
</ul>
</li>
</ul>
<p>结果：OC</p>
<h1 id="拼多多"><a href="#拼多多" class="headerlink" title="拼多多"></a>拼多多</h1><h2 id="第一面-4-18-50m"><a href="#第一面-4-18-50m" class="headerlink" title="第一面(4.18,50m)"></a>第一面(4.18,50m)</h2><ul>
<li>自我介绍</li>
<li>项目介绍，遇到的问题</li>
<li>除了实习，你还做过些什么项目，讲讲</li>
<li>单链表和双链表的区别，在内存方面呢？</li>
<li>C++多线程怎么创建的</li>
<li>C++多线程怎么保证安全？互斥是怎么实现的，操作系统怎么实现互斥的？</li>
<li>单例模式的实现，手写代码</li>
<li>遇到过的数组越界</li>
<li>C++内存管理怎么做的</li>
<li>tcp和udp的区别，tcp和http的区别</li>
<li>使用过消息队列没有？</li>
<li>Linux一些常用的命令讲讲</li>
<li>简历中的论文介绍</li>
<li>讲讲最有印象的书或者看过的开源项目</li>
<li>讲讲区块链技术</li>
<li><p>主要做支付这块的东西</p>
</li>
<li><p>建议：多多看看一些公司所使用的技术</p>
</li>
</ul>
<h2 id="第二面-4-18-50m"><a href="#第二面-4-18-50m" class="headerlink" title="第二面(4.18, 50m)"></a>第二面(4.18, 50m)</h2><h2 id="第二面（4-18）"><a href="#第二面（4-18）" class="headerlink" title="第二面（4.18）"></a>第二面（4.18）</h2><h1 id="百度"><a href="#百度" class="headerlink" title="百度"></a>百度</h1><h2 id="第一面-4-18-30m"><a href="#第一面-4-18-30m" class="headerlink" title="第一面(4.18,30m)"></a>第一面(4.18,30m)</h2><ul>
<li>自我介绍</li>
<li>项目介绍</li>
<li>STL的vector实现，数据增长怎么办，时间复杂度分析</li>
<li>手写字符串匹配，Kmp和动态规划实现</li>
<li>讲讲你看过的开源项目</li>
</ul>
<h2 id="第二面-4-18-20m"><a href="#第二面-4-18-20m" class="headerlink" title="第二面(4.18,20m)"></a>第二面(4.18,20m)</h2><ul>
<li>自我介绍</li>
<li>redis可以给一个key设置一个时间，过了时间就会在内存中消失，这个怎么实现的</li>
<li>手写LRU算法</li>
<li><p>以及一道算法题</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">## 扩散</span><br><span class="line">限定语言：Python、C++、Javascript、Python <span class="number">3</span>、Java、Go</span><br><span class="line">牛牛作为牛客王国的探险先锋，来到了一片新的大陆。</span><br><span class="line">这片大陆一共有n个工厂，有n<span class="number">-1</span>对工厂之间有管道相连，因为工厂之间需要合作，所以这n<span class="number">-1</span>个管道保证任意两个工厂都可以通过管道互相抵达。</span><br><span class="line">每个工厂最开始的生产力都是<span class="number">0</span>。</span><br><span class="line"></span><br><span class="line">现在牛牛知道了m次生产力提升发生的工厂位置。牛牛想知道这m次提升发生之后每个工厂的生产力是多少</span><br><span class="line"></span><br><span class="line"><span class="number">4</span>,<span class="number">2</span>,[<span class="number">1</span>,<span class="number">2</span>,<span class="number">2</span>],[<span class="number">2</span>,<span class="number">3</span>,<span class="number">4</span>],[<span class="number">2</span>,<span class="number">1</span>]</span><br><span class="line">输出</span><br><span class="line">[<span class="number">2</span>,<span class="number">2</span>,<span class="number">1</span>,<span class="number">1</span>]</span><br><span class="line">说明</span><br><span class="line">第一次生产力提升发生在工厂<span class="number">2</span>，工厂<span class="number">1</span>，<span class="number">2</span>，<span class="number">3</span>，<span class="number">4</span>的生产力都提升了<span class="number">1</span>点</span><br><span class="line">第二次生产力提升发生在工厂<span class="number">1</span>，工厂<span class="number">1</span>，<span class="number">2</span>的生产力都提升了<span class="number">1</span>点</span><br><span class="line">最终工厂<span class="number">1</span>，<span class="number">2</span>的生产力都为<span class="number">2</span>，工厂<span class="number">3</span>，<span class="number">4</span>的生产力都为<span class="number">1</span></span><br></pre></td></tr></table></figure>
</li>
<li><p>tcp的用到的一些算法</p>
</li>
<li>线程和进程的区别</li>
<li>实验室有没有啥项目</li>
</ul>
<h1 id="华为"><a href="#华为" class="headerlink" title="华为"></a>华为</h1><h2 id="第一面（4-21-40m）"><a href="#第一面（4-21-40m）" class="headerlink" title="第一面（4.21, 40m）"></a>第一面（4.21, 40m）</h2><ul>
<li>一道算法题</li>
</ul>
<p>最长公共后缀。</p>
<p>比如有一个字符串数组[“abcd”, “ercd”, “abdecd”]，返回“cd”</p>
<p>[“abcdfg”, “abcdgf”]，返回“”</p>
<ul>
<li>自我介绍</li>
<li>项目介绍，遇到的问题，在实习中学到了什么</li>
</ul>
<h2 id="第二面（4-23，-17m）"><a href="#第二面（4-23，-17m）" class="headerlink" title="第二面（4.23， 17m）"></a>第二面（4.23， 17m）</h2><p>聊人生</p>
<ul>
<li>自我介绍</li>
<li>做过的导师的项目或者实习遇到的问题讲讲</li>
<li>那种长周期的任务，比如过半年的，遇到的问题讲讲</li>
<li>参加过社团，干了多久，为啥后面不继续了</li>
<li>了解华为的价值观吗？对于华为加班和一些不好的说法，你怎么看待？</li>
</ul>
<h1 id="网易互娱"><a href="#网易互娱" class="headerlink" title="网易互娱"></a>网易互娱</h1><h2 id="第一面（4-24，-50m）"><a href="#第一面（4-24，-50m）" class="headerlink" title="第一面（4.24， 50m）"></a>第一面（4.24， 50m）</h2><ul>
<li>自我介绍</li>
<li>四道算法题</li>
</ul>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">给一个长度为n的字符串，找最长的不包含相同字符的子串</span><br><span class="line"></span><br><span class="line">气温变暖</span><br><span class="line">小M比较怕冷，所以每天都很关注什么时候会升温。</span><br><span class="line">现在请你写一个小程序，帮助她了解过多少天温度才会上升。</span><br><span class="line">输入描述</span><br><span class="line">输入为今天到后N天的温度预测，如<span class="number">2</span>,<span class="number">5</span>表示今天温度为<span class="number">2</span>度，明天为<span class="number">5</span>度</span><br><span class="line">输出描述</span><br><span class="line">打印为每一天需要等多久才能比当天的温度高，用数组表示，如果没有，用<span class="number">0</span>表示，如<span class="number">1</span>,<span class="number">0</span></span><br><span class="line">示例<span class="number">1</span></span><br><span class="line">输入</span><br><span class="line"><span class="number">2</span>,<span class="number">5</span>,<span class="number">8</span>,<span class="number">7</span>,<span class="number">9</span></span><br><span class="line">输出</span><br><span class="line"><span class="number">1</span>,<span class="number">1</span>,<span class="number">2</span>,<span class="number">1</span>,<span class="number">0</span></span><br><span class="line">    </span><br><span class="line">一个有n*m个格子的矩形，玩家起始点在左下角，每回合可以向上<span class="number">1</span>步或<span class="number">2</span>步或向右走<span class="number">1</span>步或<span class="number">2</span>步。计算走到右上角共有多少种走法。</span><br><span class="line">    </span><br><span class="line">N个玩家，给出每个玩家攻击和防御的排名，每个玩家都只愿意跟有一项属性高于自己的玩家组队。问这些玩家中一共可以组出多少个不同的队伍。</span><br></pre></td></tr></table></figure>
<h1 id="微软苏州"><a href="#微软苏州" class="headerlink" title="微软苏州"></a>微软苏州</h1><h2 id="第一面-3"><a href="#第一面-3" class="headerlink" title="第一面"></a>第一面</h2><ul>
<li>自我介绍</li>
<li>项目</li>
<li>手撕代码</li>
</ul>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">ip地址是否合法</span><br><span class="line">把ip地址映射到一个合法的整数</span><br></pre></td></tr></table></figure>
<h2 id="第二面-2"><a href="#第二面-2" class="headerlink" title="第二面"></a>第二面</h2><ul>
<li>老师说第一轮评价不错，那就直接上代码</li>
<li>二叉树中找到最大的二叉搜索树，最大表示节点数量最高</li>
</ul>
<h2 id="第三面"><a href="#第三面" class="headerlink" title="第三面"></a>第三面</h2><p>手撕代码：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// str1: abcd_1 -&gt; abc   </span></span><br><span class="line"><span class="comment">// str2: _2ac_1bcd_1 -&gt; abc</span></span><br><span class="line"><span class="comment">//_表示删除键，数字表示删除键的个数</span></span><br><span class="line"><span class="function"><span class="keyword">bool</span> <span class="title">compare</span><span class="params">(<span class="built_in">string</span> str1, <span class="built_in">string</span> str2)</span></span>&#123;</span><br><span class="line">    </span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>
<ul>
<li>项目介绍</li>
<li>团队合作的例子</li>
<li>C++链接和编译中的一些错误</li>
</ul>

      
    </div>
    
    
    

    
      <div>
        <div id="wechat_subscriber" style="display: block; padding: 10px 0; margin: 20px auto; width: 100%; text-align: center">
    <img id="wechat_subscriber_qcode" src="/images/wechat-qcode.jpg" alt="zxp wechat" style="width: 200px; max-width: 100%;"/>
    <div>欢迎关注微信公众号！</div>
</div>

      </div>
    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div></div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/images/WeChatpay.jpg" alt="zxp 微信支付"/>
        <p>微信支付</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/images/Alipay.jpg" alt="zxp 支付宝"/>
        <p>支付宝</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    
      <div>
        <ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者：</strong>
    zxp
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://zxpgo.github.io/2020/04/04/C++面经总结/" title="C++后端和桌面端开发面试总结-2021暑期实习">https://zxpgo.github.io/2020/04/04/C++面经总结/</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>
    本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/3.0/" rel="external nofollow" target="_blank">CC BY-NC-SA 3.0</a> 许可协议。转载请注明出处！
  </li>
</ul>

      </div>
    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tag/面经-C/" rel="tag"># 面经 - C++</a>
          
        </div>
      

      
      
        <div class="post-widgets">
        

        

        
          
          <div id="needsharebutton-postbottom">
            <span class="btn">
              <i class="fa fa-share-alt" aria-hidden="true"></i>
            </span>
          </div>
        
        </div>
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2020/03/26/背包问题整理/" rel="next" title="背包问题整理">
                <i class="fa fa-chevron-left"></i> 背包问题整理
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2020/04/10/拼多多笔试-2020-4-10/" rel="prev" title="拼多多笔试-2020.4.10">
                拼多多笔试-2020.4.10 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  
    <div class="comments" id="comments">
      <div id="lv-container" data-id="city" data-uid="MTAyMC8zODgxNC8xNTM0Mg=="></div>
    </div>

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image"
                src="/images/avatar.gif"
                alt="zxp" />
            
              <p class="site-author-name" itemprop="name">zxp</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">176</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">16</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">48</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          
            <div class="feed-link motion-element">
              <a href="/atom.xml" rel="alternate">
                <i class="fa fa-rss"></i>
                RSS
              </a>
            </div>
          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://blog.csdn.net/qq_25774883" target="_blank" title="CSDN">
                      
                        <i class="fa fa-fw fa-globe"></i>CSDN</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/zxpgo/zxpgo" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-globe"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.linkedin.com/feed/" target="_blank" title="LinkedIn">
                      
                        <i class="fa fa-fw fa-globe"></i>LinkedIn</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="1165772354@qq.com" target="_blank" title="E-Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>E-Mail</a>
                  </span>
                
            </div>
          

          
          

          
          
            <div class="links-of-blogroll motion-element links-of-blogroll-inline">
              <div class="links-of-blogroll-title">
                <i class="fa  fa-fw fa-link"></i>
                友情链接
              </div>
              <ul class="links-of-blogroll-list">
                
                  <li class="links-of-blogroll-item">
                    <a href="http://theme-next.iissnan.com" title="Next主题" target="_blank">Next主题</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://blog.rexking6.top" title="青爷博客" target="_blank">青爷博客</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://me.csdn.net/download/qq_25774883" title="CSDN下载" target="_blank">CSDN下载</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://www.livere.com/" title="来必力" target="_blank">来必力</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://tongji.baidu.com/web/welcome/login" title="百度统计" target="_blank">百度统计</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://leancloud.cn/" title="LeanCloud" target="_blank">LeanCloud</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="http://ibruce.info/2015/04/04/busuanzi/" title="不蒜子" target="_blank">不蒜子</a>
                  </li>
                
                  <li class="links-of-blogroll-item">
                    <a href="https://leetcode-cn.com/" title="LeetCode" target="_blank">LeetCode</a>
                  </li>
                
              </ul>
            </div>
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#钉钉C"><span class="nav-number">1.</span> <span class="nav-text">钉钉C++</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#一面"><span class="nav-number">1.1.</span> <span class="nav-text">一面</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#二面"><span class="nav-number">1.2.</span> <span class="nav-text">二面</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#三面"><span class="nav-number">1.3.</span> <span class="nav-text">三面</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#四面-40m"><span class="nav-number">1.4.</span> <span class="nav-text">四面(40m)</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#五面-10m"><span class="nav-number">1.5.</span> <span class="nav-text">五面(10m)</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#交叉面-1h20m"><span class="nav-number">1.6.</span> <span class="nav-text">交叉面(1h20m)</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#hr面-4-10-36m"><span class="nav-number">1.7.</span> <span class="nav-text">hr面(4.10, 36m)</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#腾讯wxg后端开发"><span class="nav-number">2.</span> <span class="nav-text">腾讯wxg后端开发</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#一面-1"><span class="nav-number">2.1.</span> <span class="nav-text">一面</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#二面-1"><span class="nav-number">2.2.</span> <span class="nav-text">二面</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#三面-1"><span class="nav-number">2.3.</span> <span class="nav-text">三面</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#腾讯游戏后台安全开发"><span class="nav-number">3.</span> <span class="nav-text">腾讯游戏后台安全开发</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#第一面"><span class="nav-number">3.1.</span> <span class="nav-text">第一面</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#第二面"><span class="nav-number">3.2.</span> <span class="nav-text">第二面</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#HR面"><span class="nav-number">3.3.</span> <span class="nav-text">HR面</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#字节跳动"><span class="nav-number">4.</span> <span class="nav-text">字节跳动</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#第一面-1"><span class="nav-number">4.1.</span> <span class="nav-text">第一面</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#美团"><span class="nav-number">5.</span> <span class="nav-text">美团</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#第一面-2"><span class="nav-number">5.1.</span> <span class="nav-text">第一面</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#第二面-1"><span class="nav-number">5.2.</span> <span class="nav-text">第二面</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#拼多多"><span class="nav-number">6.</span> <span class="nav-text">拼多多</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#第一面-4-18-50m"><span class="nav-number">6.1.</span> <span class="nav-text">第一面(4.18,50m)</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#第二面-4-18-50m"><span class="nav-number">6.2.</span> <span class="nav-text">第二面(4.18, 50m)</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#第二面（4-18）"><span class="nav-number">6.3.</span> <span class="nav-text">第二面（4.18）</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#百度"><span class="nav-number">7.</span> <span class="nav-text">百度</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#第一面-4-18-30m"><span class="nav-number">7.1.</span> <span class="nav-text">第一面(4.18,30m)</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#第二面-4-18-20m"><span class="nav-number">7.2.</span> <span class="nav-text">第二面(4.18,20m)</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#华为"><span class="nav-number">8.</span> <span class="nav-text">华为</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#第一面（4-21-40m）"><span class="nav-number">8.1.</span> <span class="nav-text">第一面（4.21, 40m）</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#第二面（4-23，-17m）"><span class="nav-number">8.2.</span> <span class="nav-text">第二面（4.23， 17m）</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#网易互娱"><span class="nav-number">9.</span> <span class="nav-text">网易互娱</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#第一面（4-24，-50m）"><span class="nav-number">9.1.</span> <span class="nav-text">第一面（4.24， 50m）</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#微软苏州"><span class="nav-number">10.</span> <span class="nav-text">微软苏州</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#第一面-3"><span class="nav-number">10.1.</span> <span class="nav-text">第一面</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#第二面-2"><span class="nav-number">10.2.</span> <span class="nav-text">第二面</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#第三面"><span class="nav-number">10.3.</span> <span class="nav-text">第三面</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div>
<script async src="https//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<i class="fa fa-user-md"></i><span id="busuanzi_container_site_pv" style='display:none'>
    本站总访问量 <span id="busuanzi_value_site_pv"></span> 
    <span class="post-meta-divider">|</span>
</span>
<span id="busuanzi_container_site_uv" style='display:none'>
    访问人数 <span id="busuanzi_value_site_uv"></span>
</span>
</div>


<script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

<div class="copyright">&copy; 2018-8 &mdash; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-"></i> Power by 
  </span>
  <span class="author" itemprop="copyrightHolder">zxp</span>
  
  
</div>









        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    
      <div id="needsharebutton-float">
        <span class="btn">
          <i class="fa fa-share-alt" aria-hidden="true"></i>
        </span>
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  




  
  <div id="lv-container" data-uid="MTAyMC8zODgxNC8xNTM0Mg==">
    <script type="text/javascript">
      (function(d, s) {
        var j, e = d.getElementsByTagName(s)[0];
        if (typeof LivereTower === 'function') { return; }
        j = d.createElement(s);
        j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
        j.async = true;
        e.parentNode.insertBefore(j, e);
      })(document, 'script');
    </script>
	</div>
  











  

  <script type="text/javascript">
    // Popup Window;
    var isfetched = false;
    var isXml = true;
    // Search DB path;
    var search_path = "search.xml";
    if (search_path.length === 0) {
      search_path = "search.xml";
    } else if (/json$/i.test(search_path)) {
      isXml = false;
    }
    var path = "/" + search_path;
    // monitor main search box;

    var onPopupClose = function (e) {
      $('.popup').hide();
      $('#local-search-input').val('');
      $('.search-result-list').remove();
      $('#no-result').remove();
      $(".local-search-pop-overlay").remove();
      $('body').css('overflow', '');
    }

    function proceedsearch() {
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay"></div>')
        .css('overflow', 'hidden');
      $('.search-popup-overlay').click(onPopupClose);
      $('.popup').toggle();
      var $localSearchInput = $('#local-search-input');
      $localSearchInput.attr("autocapitalize", "none");
      $localSearchInput.attr("autocorrect", "off");
      $localSearchInput.focus();
    }

    // search function;
    var searchFunc = function(path, search_id, content_id) {
      'use strict';

      // start loading animation
      $("body")
        .append('<div class="search-popup-overlay local-search-pop-overlay">' +
          '<div id="search-loading-icon">' +
          '<i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>' +
          '</div>' +
          '</div>')
        .css('overflow', 'hidden');
      $("#search-loading-icon").css('margin', '20% auto 0 auto').css('text-align', 'center');

      $.ajax({
        url: path,
        dataType: isXml ? "xml" : "json",
        async: true,
        success: function(res) {
          // get the contents from search data
          isfetched = true;
          $('.popup').detach().appendTo('.header-inner');
          var datas = isXml ? $("entry", res).map(function() {
            return {
              title: $("title", this).text(),
              content: $("content",this).text(),
              url: $("url" , this).text()
            };
          }).get() : res;
          var input = document.getElementById(search_id);
          var resultContent = document.getElementById(content_id);
          var inputEventFunction = function() {
            var searchText = input.value.trim().toLowerCase();
            var keywords = searchText.split(/[\s\-]+/);
            if (keywords.length > 1) {
              keywords.push(searchText);
            }
            var resultItems = [];
            if (searchText.length > 0) {
              // perform local searching
              datas.forEach(function(data) {
                var isMatch = false;
                var hitCount = 0;
                var searchTextCount = 0;
                var title = data.title.trim();
                var titleInLowerCase = title.toLowerCase();
                var content = data.content.trim().replace(/<[^>]+>/g,"");
                var contentInLowerCase = content.toLowerCase();
                var articleUrl = decodeURIComponent(data.url);
                var indexOfTitle = [];
                var indexOfContent = [];
                // only match articles with not empty titles
                if(title != '') {
                  keywords.forEach(function(keyword) {
                    function getIndexByWord(word, text, caseSensitive) {
                      var wordLen = word.length;
                      if (wordLen === 0) {
                        return [];
                      }
                      var startPosition = 0, position = [], index = [];
                      if (!caseSensitive) {
                        text = text.toLowerCase();
                        word = word.toLowerCase();
                      }
                      while ((position = text.indexOf(word, startPosition)) > -1) {
                        index.push({position: position, word: word});
                        startPosition = position + wordLen;
                      }
                      return index;
                    }

                    indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false));
                    indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false));
                  });
                  if (indexOfTitle.length > 0 || indexOfContent.length > 0) {
                    isMatch = true;
                    hitCount = indexOfTitle.length + indexOfContent.length;
                  }
                }

                // show search results

                if (isMatch) {
                  // sort index by position of keyword

                  [indexOfTitle, indexOfContent].forEach(function (index) {
                    index.sort(function (itemLeft, itemRight) {
                      if (itemRight.position !== itemLeft.position) {
                        return itemRight.position - itemLeft.position;
                      } else {
                        return itemLeft.word.length - itemRight.word.length;
                      }
                    });
                  });

                  // merge hits into slices

                  function mergeIntoSlice(text, start, end, index) {
                    var item = index[index.length - 1];
                    var position = item.position;
                    var word = item.word;
                    var hits = [];
                    var searchTextCountInSlice = 0;
                    while (position + word.length <= end && index.length != 0) {
                      if (word === searchText) {
                        searchTextCountInSlice++;
                      }
                      hits.push({position: position, length: word.length});
                      var wordEnd = position + word.length;

                      // move to next position of hit

                      index.pop();
                      while (index.length != 0) {
                        item = index[index.length - 1];
                        position = item.position;
                        word = item.word;
                        if (wordEnd > position) {
                          index.pop();
                        } else {
                          break;
                        }
                      }
                    }
                    searchTextCount += searchTextCountInSlice;
                    return {
                      hits: hits,
                      start: start,
                      end: end,
                      searchTextCount: searchTextCountInSlice
                    };
                  }

                  var slicesOfTitle = [];
                  if (indexOfTitle.length != 0) {
                    slicesOfTitle.push(mergeIntoSlice(title, 0, title.length, indexOfTitle));
                  }

                  var slicesOfContent = [];
                  while (indexOfContent.length != 0) {
                    var item = indexOfContent[indexOfContent.length - 1];
                    var position = item.position;
                    var word = item.word;
                    // cut out 100 characters
                    var start = position - 20;
                    var end = position + 80;
                    if(start < 0){
                      start = 0;
                    }
                    if (end < position + word.length) {
                      end = position + word.length;
                    }
                    if(end > content.length){
                      end = content.length;
                    }
                    slicesOfContent.push(mergeIntoSlice(content, start, end, indexOfContent));
                  }

                  // sort slices in content by search text's count and hits' count

                  slicesOfContent.sort(function (sliceLeft, sliceRight) {
                    if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) {
                      return sliceRight.searchTextCount - sliceLeft.searchTextCount;
                    } else if (sliceLeft.hits.length !== sliceRight.hits.length) {
                      return sliceRight.hits.length - sliceLeft.hits.length;
                    } else {
                      return sliceLeft.start - sliceRight.start;
                    }
                  });

                  // select top N slices in content

                  var upperBound = parseInt('1');
                  if (upperBound >= 0) {
                    slicesOfContent = slicesOfContent.slice(0, upperBound);
                  }

                  // highlight title and content

                  function highlightKeyword(text, slice) {
                    var result = '';
                    var prevEnd = slice.start;
                    slice.hits.forEach(function (hit) {
                      result += text.substring(prevEnd, hit.position);
                      var end = hit.position + hit.length;
                      result += '<b class="search-keyword">' + text.substring(hit.position, end) + '</b>';
                      prevEnd = end;
                    });
                    result += text.substring(prevEnd, slice.end);
                    return result;
                  }

                  var resultItem = '';

                  if (slicesOfTitle.length != 0) {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + highlightKeyword(title, slicesOfTitle[0]) + "</a>";
                  } else {
                    resultItem += "<li><a href='" + articleUrl + "' class='search-result-title'>" + title + "</a>";
                  }

                  slicesOfContent.forEach(function (slice) {
                    resultItem += "<a href='" + articleUrl + "'>" +
                      "<p class=\"search-result\">" + highlightKeyword(content, slice) +
                      "...</p>" + "</a>";
                  });

                  resultItem += "</li>";
                  resultItems.push({
                    item: resultItem,
                    searchTextCount: searchTextCount,
                    hitCount: hitCount,
                    id: resultItems.length
                  });
                }
              })
            };
            if (keywords.length === 1 && keywords[0] === "") {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-search fa-5x" /></div>'
            } else if (resultItems.length === 0) {
              resultContent.innerHTML = '<div id="no-result"><i class="fa fa-frown-o fa-5x" /></div>'
            } else {
              resultItems.sort(function (resultLeft, resultRight) {
                if (resultLeft.searchTextCount !== resultRight.searchTextCount) {
                  return resultRight.searchTextCount - resultLeft.searchTextCount;
                } else if (resultLeft.hitCount !== resultRight.hitCount) {
                  return resultRight.hitCount - resultLeft.hitCount;
                } else {
                  return resultRight.id - resultLeft.id;
                }
              });
              var searchResultList = '<ul class=\"search-result-list\">';
              resultItems.forEach(function (result) {
                searchResultList += result.item;
              })
              searchResultList += "</ul>";
              resultContent.innerHTML = searchResultList;
            }
          }

          if ('auto' === 'auto') {
            input.addEventListener('input', inputEventFunction);
          } else {
            $('.search-icon').click(inputEventFunction);
            input.addEventListener('keypress', function (event) {
              if (event.keyCode === 13) {
                inputEventFunction();
              }
            });
          }

          // remove loading animation
          $(".local-search-pop-overlay").remove();
          $('body').css('overflow', '');

          proceedsearch();
        }
      });
    }

    // handle and trigger popup window;
    $('.popup-trigger').click(function(e) {
      e.stopPropagation();
      if (isfetched === false) {
        searchFunc(path, 'local-search-input', 'local-search-result');
      } else {
        proceedsearch();
      };
    });

    $('.popup-btn-close').click(onPopupClose);
    $('.popup').click(function(e){
      e.stopPropagation();
    });
    $(document).on('keyup', function (event) {
      var shouldDismissSearchPopup = event.which === 27 &&
        $('.search-popup').is(':visible');
      if (shouldDismissSearchPopup) {
        onPopupClose();
      }
    });
  </script>





  

  
  <script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.4.js"></script>
  <script>AV.initialize("2AyV3DKioBSdoryrFLRohzjB-gzGzoHsz", "XynedcHyJCVCrTfbD4yYnodo");</script>
  <script>
    function showTime(Counter) {
      var query = new AV.Query(Counter);
      var entries = [];
      var $visitors = $(".leancloud_visitors");

      $visitors.each(function () {
        entries.push( $(this).attr("id").trim() );
      });

      query.containedIn('url', entries);
      query.find()
        .done(function (results) {
          var COUNT_CONTAINER_REF = '.leancloud-visitors-count';

          if (results.length === 0) {
            $visitors.find(COUNT_CONTAINER_REF).text(0);
            return;
          }

          for (var i = 0; i < results.length; i++) {
            var item = results[i];
            var url = item.get('url');
            var time = item.get('time');
            var element = document.getElementById(url);

            $(element).find(COUNT_CONTAINER_REF).text(time);
          }
          for(var i = 0; i < entries.length; i++) {
            var url = entries[i];
            var element = document.getElementById(url);
            var countSpan = $(element).find(COUNT_CONTAINER_REF);
            if( countSpan.text() == '') {
              countSpan.text(0);
            }
          }
        })
        .fail(function (object, error) {
          console.log("Error: " + error.code + " " + error.message);
        });
    }

    function addCount(Counter) {
      var $visitors = $(".leancloud_visitors");
      var url = $visitors.attr('id').trim();
      var title = $visitors.attr('data-flag-title').trim();
      var query = new AV.Query(Counter);

      query.equalTo("url", url);
      query.find({
        success: function(results) {
          if (results.length > 0) {
            var counter = results[0];
            counter.fetchWhenSave(true);
            counter.increment("time");
            counter.save(null, {
              success: function(counter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(counter.get('time'));
              },
              error: function(counter, error) {
                console.log('Failed to save Visitor num, with error message: ' + error.message);
              }
            });
          } else {
            var newcounter = new Counter();
            /* Set ACL */
            var acl = new AV.ACL();
            acl.setPublicReadAccess(true);
            acl.setPublicWriteAccess(true);
            newcounter.setACL(acl);
            /* End Set ACL */
            newcounter.set("title", title);
            newcounter.set("url", url);
            newcounter.set("time", 1);
            newcounter.save(null, {
              success: function(newcounter) {
                var $element = $(document.getElementById(url));
                $element.find('.leancloud-visitors-count').text(newcounter.get('time'));
              },
              error: function(newcounter, error) {
                console.log('Failed to create');
              }
            });
          }
        },
        error: function(error) {
          console.log('Error:' + error.code + " " + error.message);
        }
      });
    }

    $(function() {
      var Counter = AV.Object.extend("Counter");
      if ($('.leancloud_visitors').length == 1) {
        addCount(Counter);
      } else if ($('.post-title-link').length > 1) {
        showTime(Counter);
      }
    });
  </script>



  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
  
  
  <link rel="stylesheet" href="/lib/needsharebutton/needsharebutton.css">

  
  
  <script src="/lib/needsharebutton/needsharebutton.js"></script>

  <script>
    
      pbOptions = {};
      
          pbOptions.iconStyle = "default";
      
          pbOptions.boxForm = "vertical";
      
          pbOptions.position = "top";
      
          pbOptions.networks = "Weibo,Wechat,Douban,QQZone,Twitter,Facebook";
      
      new needShareButton('#needsharebutton-postbottom', pbOptions);
    
    
      flOptions = {};
      
          flOptions.iconStyle = "box";
      
          flOptions.boxForm = "horizontal";
      
          flOptions.position = "middleRight";
      
          flOptions.networks = "Weibo,Wechat,Douban,QQZone,Twitter,Facebook";
      
      new needShareButton('#needsharebutton-float', flOptions);
    
  </script>

  

  
  


  
  <script type="text/javascript" src="/js/src/js.cookie.js?v=5.1.4"></script>
  <script type="text/javascript" src="/js/src/scroll-cookie.js?v=5.1.4"></script>


  
  <script type="text/javascript" src="/js/src/exturl.js?v=5.1.4"></script>


  
  
  	 <!-- custom analytics part create by xiamo -->
<script src="https://cdn1.lncld.net/static/js/av-core-mini-0.6.1.js"></script>
<script>AV.initialize("2AyV3DKioBSdoryrFLRohzjB-gzGzoHsz", "XynedcHyJCVCrTfbD4yYnodo");</script>
<script>
function showTime(Counter) {
	var query = new AV.Query(Counter);
	$(".leancloud_visitors").each(function() {
		var url = $(this).attr("id").trim();
		query.equalTo("url", url);
		query.find({
			success: function(results) {
				if (results.length == 0) {
					var content = $(document.getElementById(url)).text() + ' 0';
					$(document.getElementById(url)).text(content);
					return;
				}
				for (var i = 0; i < results.length; i++) {
					var object = results[i];
					var content = $(document.getElementById(url)).text() + ' ' + object.get('time');
					$(document.getElementById(url)).text(content);
				}
			}
		});

	});
}

</script>
  
</body>
</html>
